<template>
  <div class="music" @click="show">
    <audio src="@/assets/music.mp3" controls ref="audio" :class={show:isvisible,audio:true}></audio>
    <div class="button el-icon-caret-right"></div>
  </div>
</template>

<script>
export default {
    data(){
        return{
            isvisible:true
        }
    },
    methods:{
        show(){
            this.isvisible=!this.isvisible
        }
    }
}
</script>

<style lang="less" scoped>
.show{
    display: none;
}
.music{
    cursor: pointer;
    position: fixed;
    z-index: 4;
    width: 60px;
    height: 54px;
    background-color: aqua;
    bottom:10px;
    left: 10px;
    background: url('@/assets/music.png') no-repeat;
    background-size: 80px;
}
.audio{
    margin-left: 60px;
}
.button{
    position: absolute;
    width: 44px;
    height: 44px;
    z-index: 5;
    top: 5px;
    left: 8px;
    border-radius: 50%;
    text-align: center;
    line-height: 42px;
    font-size: 26px;
    border: 1px solid #dedcdc;
    background-color: rgba(0,0,0,0.4);
    color: #dedcdc;
}
audio::-webkit-media-controls-panel { background-color: rgb(254, 82, 194); /* 更改背景颜色 */
}

 audio::-webkit-media-controls { border: 6px solid #7522da; /* 添加边框 */
    transition: 0.5s;
    border-radius: 30px;
    
 }
  audio::-webkit-media-controls-play-button { background-color:aqua;
    border-radius: 50%; /* 更改播放按钮的颜色 */ }
   audio::-webkit-media-controls-mute-button { display: none; /* 隐藏静音按钮 */ }
    // audio::-webkit-media-controls-volume-slider { width: 100px; /* 更改音量滑块的宽度 */ } 
    // audio::-webkit-media-controls-time-display { font-size: 14px;
    //  }
</style>